package com.itheima.app;

import com.itheima.dao.TeacherDao;
import com.itheima.dao.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class IOC2App {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("application-config.xml");
        UserDao userDao = (UserDao) context.getBean("userDao");
        userDao.save();
        System.out.println("-----------华丽的分割线----------");
        TeacherDao teacherDao = (TeacherDao) context.getBean("teacherDao");
        teacherDao.save();
    }
}
